#ifndef UGAME_CONTROLLER_H
#define UGAME_CONTROLLER_H

#include "cocos2d.h"
#include "../default/UGApplication.h"
#include "../default/UGDefaultEventHandler.h"
#include "../default/UGDefaultEvent.h"

USING_NS_CC;

namespace ugame {
    class UGController : public Ref {
        UG_PROPERTY_GETTER(UGEventNotifier*, eventNotifier, EventNotifier);
	private:
        virtual void notify(int eventId, int eventType, Ref* sender, float delayTime, void* eventArg);
    public:
        UGController();
        virtual ~UGController();
        virtual void registerHandler(UGEventHandler* handler);
        virtual void registerHandler(int order, Ref* handlerObj, UGHandlerFunc handlerFunc);
        virtual void registerHandlerByEventId(int eventId, int order, Ref* handlerObj, UGHandlerFunc handlerFunc);
        virtual void registerHandlerByEventType(int eventType, int order, Ref* handlerObj, UGHandlerFunc handlerFunc);
		virtual void notify(UGEvent* event);
    };
}

#endif
